package com.boge.ai.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Description;
import org.springframework.format.annotation.DurationFormat;

import java.util.function.Function;

@Configuration
public class ToolConfig {
    public static final String WEATHER_TOOL = "currentWeather";

    @Bean(WEATHER_TOOL)
    @Description("获取指定地点的天气")
    Function<WeatherRequest, WeatherResponse> currentWeather() {
        return request -> new WeatherResponse(30.0, request.unit());
    }
}

record WeatherRequest(String location, DurationFormat.Unit unit) {}
record WeatherResponse(double temp, DurationFormat.Unit unit) {}
